home *** CD-ROM | disk | FTP | other *** search
- #ifndef VIDEOWRAPPER_H
- #define VIDEOWRAPPER_H
-
- #define DECODER_READ_BUFFER 2048
- #define SEQ_FINISHED 234
- #define SEQ_STARTED 235
- #define SEQ_FIRSTTIME 236
-
- //ERRORS
- #define END_OF_STREAM 1
- #define PLAYER_STOPPED 2
-
-
- #define MEM_Y 1024*1024
- #define MEM_C 1024*1024
-
-
- #include "..\Demux\Demux.h"
- #include "..\FlasKMPEG.h" // Added by ClassView
- #include "..\YUVtoRGB.h"
-
- #define FREE 0
- #define FULL 3
-
- #define MINUS 4
- #define EQUAL 5
- #define PLUS 6
- //#define TOP_FIELD 2
- //#define BOTTOM_FIELD 3
-
- #define A 0
- #define B 1
- struct TRecImage
- {
- YUVImageTag im;
- int state;
- i64 PTS;
- };
-
- struct TDoubleBuffer
- {
- TRecImage *rec[2];
- };
-
- typedef struct timeCodeTag
- {
- int hour;
- int minute;
- int second;
- int frame;
- } TTimeCode;
-
- struct presInfo
- {
- i64 imagePTS;
- i64 imageSCR;
- bool SCRlocked;
- };
-
- struct TFrameInfo
- {
- i64 PTS;
- i64 SCR;
- int progressive_frame;
- int repeat_first_field;
- int picture_structure;
- int top_field_first;
- };
-
- struct presTimes
- {
- TFrameInfo actual;
- TFrameInfo image;
- TFrameInfo fordward;
- TFrameInfo backward;
- };
-
- struct TVideoOptions
- {
- int idctType;
- bool recons_progressive;
- };
-
-
- class VideoWrapper: public CDemux
- {
- public:
- int subStreamID;
- int streamID;
- int subpic_substreamID, subpic_streamID; /* -1 = off */
- char * GetVideoFileName();
- i64 GetVideoSize();
- i64 GetVideoPos();
- bool seqIsProgressive;
- int GetFrameRateCode(double fr);
- bool gopFlag;
- bool SCRlocked;
- i64 previousPicSCR;
- presTimes p;
- __int64 internalPTS;
- char sDetectedFPS[256];
- char sAspectRatio[256];
- char sFrameRate[256];
- char sVideoSize[256];
- char sBitrate[256];
- char sProgressive[256];
- bool PTSlocked;
- int GetError();
-
- double frameDelay;
- double frameRate;
- double DAR;
- unsigned int totalFrames;
- int SeekVideo( __int64 pos );
- YUVimage YUV;
- bool isDecoding;
- bool stopDecoding;
- int Start(TVideoOptions *opt);
- int Stop();
- VideoWrapper( char *inputFile, int streamID, int subStreamID, int subpic_streamID, int subpic_substreamID, int mode );
- ~VideoWrapper();
- int pictureWidth;
- int picutreHeight;
- int VideoWrapper::GetFrame(presInfo *pInfo, YUVImageTag **frame);
- TTimeCode timeCode;
- int idctType;
- unsigned int endTime, time;
- PESinfo myPES;
- void ResetRawPTS(); int detectedFrameRateCode;
- __int64 firstSCR, lastSCR, firstPTS, lastPTS;
- private:
- bool justStarted;
- i64 get_time(int field);
- void swap_db();
- TRecImage reca;
- TRecImage recb;
- int rec_first;
- TDoubleBuffer dbuf;
- //Pull down stuff
- int get_frame();
- int guess_32pulldown();
- void adjust_pulldown_timing();
- i64 interlaced_field_delay;
- i64 progressive_frame_delay;
- int pulldown_state;
- bool pullDownDetected;
- bool recons_progressive;
-
- double detectedFrameDelay;
- int prevProgressiveFrame;
- int prevRepeatFirstField;
-
-
- int detectFrameRate();
- double detectedFrameRate;
-
- updateVideoStats();
- int error;
-
- int outGopPos;
-
- bool StartingDecoder;
- bool firstReadTime;
- bool stopDecoder;
- bool decoderStopped;
- int Return_Value;
- int Bitstream_Framenum;
- int Sequence_Framenum;
- int sequencePos;
- char startBuffer[DECODER_READ_BUFFER];
-
- };
-
-
-
-
-
-
- #endif